﻿<Window x:Class="SRF.View.ReceiveView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:SRF.Converters"
        xmlns:res="clr-namespace:SRF.Resources"
        Title="{x:Static res:Resource.ReceiveTitle}" Width="420" Height="132" WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize">
    <Window.Resources>
        <Style TargetType="{x:Type TextBox}">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    
	<Grid>
		<TextBlock HorizontalAlignment="Left" Margin="8,11,0,0" TextWrapping="Wrap" Text="{x:Static res:Resource.AddressBox}" VerticalAlignment="Top" />
        <TextBox x:Name="addrBox" Margin="57,8,92,0" VerticalAlignment="Top">
            <TextBox.Text>
                <Binding Path="Address">
                    <Binding.ValidationRules>
                        <converters:IPAddressValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox.Text>
        </TextBox>
        <TextBox Margin="0,8,8,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="80" Text="{Binding Port}" />
		<TextBlock HorizontalAlignment="Left" Margin="8,36,0,0" TextWrapping="Wrap" Text="{x:Static res:Resource.FolderBox}" VerticalAlignment="Top" />
        <TextBox Margin="57,34,92,0" VerticalAlignment="Top" Text="{Binding Folder}" />
		<Button Content="{x:Static res:Resource.ChooseButton}" HorizontalAlignment="Right" Margin="0,34,8,0" Width="80" VerticalAlignment="Top" Command="{Binding ChooseFolderCommand}" />
        
        <Grid Background="#FFEFEFEF" Height="39" VerticalAlignment="Bottom">
        	<Button Content="{x:Static res:Resource.OKButton}" HorizontalAlignment="Right" Margin="0,10,87,8" Width="75" Command="{Binding OKCommand}" IsDefault="True" />
            <Button Content="{x:Static res:Resource.CancelButton}" HorizontalAlignment="Right" Margin="0,0,8,8" VerticalAlignment="Bottom" Width="75" IsCancel="True" />
        </Grid>
	</Grid>
</Window>
